#region Copyright
//       Copyright (c) 2009 - Antoine Jaussoin - http://www.jaussoin.com/blog/
// 
//        This program is free software: you can redistribute it and/or modify
//        it under the terms of the GNU General Public License as published by
//        the Free Software Foundation, either version 3 of the License, or
//        (at your option) any later version.
// 
//        This program is distributed in the hope that it will be useful,
//        but WITHOUT ANY WARRANTY; without even the implied warranty of
//        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//        GNU General Public License for more details.
// 
//        You should have received a copy of the GNU General Public License
//        along with this program.  If not, see <http://www.gnu.org/licenses/>.
#endregion

using System;
using System.Collections.Generic;
using System.Reflection;

namespace FT.Architecture.Entities
{
    /// <summary>
    /// Interface for a base object
    /// </summary>
    public interface IBaseObject
    {
        /// <summary>
        /// You may override this method to provide your own comparison routine.
        /// </summary>
        bool HasSameObjectSignatureAs(IBaseObject compareTo);

        /// <summary>
        /// </summary>
        IEnumerable<PropertyInfo> GetSignatureProperties();

        /// <summary>
        /// When <c>NHibernate</c> proxies objects, it masks the type of the actual entity object.
        /// This wrapper burrows into the proxied object to get its actual type.
        /// 
        /// Although this assumes <c>NHibernate</c> is being used, it doesn't require any <c>NHibernate</c>
        /// related dependencies and has no bad side effects if <c>NHibernate</c> isn't being used.
        /// 
        /// Related discussion is at http://groups.google.com/group/sharp-architecture/browse_thread/thread/ddd05f9baede023a ...thanks Jay Oliver!
        /// </summary>
        Type GetTypeUnproxied();
    }
}